package com.softserveinc.interactive_board.domain;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.softserveinc.interactive_board.domain.constants.UserConstants;

@Entity
@Table(name = UserConstants.TABLE_NAME)
public class User  {
	
	public User(Long id, String login, String password, UserType userType, String email, String skype, String summary) {
		super();
		this.id = id;
		this.login = login;
		this.password = password;
		this.userType = userType;
		this.email = email;
		this.skype = skype;
		this.summary = summary;
	}
	
	public User(Long id) {
		super();
		this.id = id;
	}
	
	public User() {
		this(new Long(0), "login", "password", new UserType(), "", "", "");
	}

	@Id
	@Column(name = UserConstants.ID_COLUMN_NAME)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	@Column(name = UserConstants.LOGIN_COLUMN_NAME, length = UserConstants.COLUMNS_MAX_LENGTH)
	private String login;
	
	@Column(name = UserConstants.PASSWORD_COLUMN_NAME, length = UserConstants.COLUMNS_MAX_LENGTH)
	private String password;

	@ManyToOne
	@JoinColumn(name = UserConstants.USER_TYPE_COLUMN_NAME)
	private UserType userType;
	
	@Column(name = UserConstants.EMAIL_COLUMN_NAME, length = UserConstants.COLUMNS_MAX_LENGTH)
	private String email;
	
	@Column(name = UserConstants.SKYPE_COLUMN_NAME, length = UserConstants.COLUMNS_MAX_LENGTH)
	private String skype;
	
	@Column(name = UserConstants.SUMMARY_COLUMN_NAME, length = UserConstants.SUMMARY_COLUMN_MAX_LENGTH)
	private String summary;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public UserType getUserType() {
		return userType;
	}

	public void setUserType(UserType userType) {
		this.userType = userType;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getSkype() {
		return skype;
	}

	public void setSkype(String skype) {
		this.skype = skype;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}
	
}